<include file="Public:header" />

<link rel="stylesheet" type="text/css" href="__PUBLIC__/front/css/orders.css" media="all">

<div id="home">

    <div id="header">

        <div style="height:28px; padding-top:10px; background:url(__PUBLIC__/Front/images/xy.png) 10px 8px no-repeat" class="logo"><span onclick=" history.go( - 1);">&nbsp;</span></div>

        <div class="shoptitle">
            <span>我的订单</span>
        </div>

        <include file="Public:righttop" />

    </div>

</div>

<include file="Public:procat" />

<div class="o_box">

    <ul class="order_menu_box" id="navi">

        <li>
            <a class="<?php if($currentTab == 'all') echo 'menu_current current'; ?>" href="{:U('Member/Order',array('type'=>'all'))}">全部</a>
        </li>

        <li>
            <a class="<?php if($currentTab == 'waitPay') echo 'menu_current current'; ?>" href="{:U('Member/Order',array('type'=>'waitPay'))}">待付款</a>
        </li>

        <li>
            <a class="<?php if($currentTab == 'waitSend') echo 'menu_current current'; ?>" href="{:U('Member/Order',array('type'=>'waitSend'))}">待发货</a>
        </li>

        <li>
            <a class="<?php if($currentTab == 'wait') echo 'menu_current current'; ?>" href="{:U('Member/Order',array('type'=>'wait'))}">待收货</a>
        </li>

        <li>
            <a class="<?php if($currentTab == 'finish') echo 'menu_current current'; ?>" href="{:U('Member/Order',array('type'=>'finish'))}">已完成</a>
        </li>

    </ul>

    <p class="o_l_a"></p>

    <p class="o_l_b"></p>

    <p class="o_l_c"></p>

    <p class="o_l_d"></p>

</div>

<ul class="public_box">

    <volist name='list' id='o'>

        <li class="am_list_box">

            <div class="am_list_a">

                <p>订单号码：<span>{$o.order_no}</span> </p>	

                <h6>{:get_order_status($o['pay_status'], $o['send_status'], $o['status'])}</h6>

            </div>

            <div class="am_list_c" id="{$o.id}" style="display: none; height: auto; line-height: 25px;">
                <p> </p>

                <h4>下单时间：{$o.create_time|date='Y-m-d H:i',###} </h4>  

                <h4> 收货人：{$o.name}</h4> 

                <h4>收货地址：{$o.address}</h4>

                <h4>联系电话：{$o.mobile}</h4>

                <!--<h4>配送方式：EMS</h4>--> 

                <h4>快递名称：{$o.express_name}</h4> 
                <h4>快递单号：{$o.express_no}</h4>

                <h4>订单状态：{:get_order_status($o['pay_status'], $o['send_status'], $o['status'], ',')}</h4>

                <p></p>	

            </div>
            
            <div class="am_list_c" id="ret{$o.id}" style="display: none; height: auto; line-height: 25px;">
                <p> </p>

                <h4 style="color: #ff3300"> 如需退货 , 请致电管理员 </h4>  

                <h4> 联系方式：{:C('WEB_SITE_USER_MOBILE')}</h4> 

                <p></p>	

            </div>
            
            

        <volist name='o.goods' id='og'>

            <div class="am_list_b">

                <div class="product_picture"><img src="{$og.cover|get_cover}"></div>

                <div class="product_text">

                    <h1>{$og.title}</h1>

                    <div class="pd_t">

                        <h2>￥{$og.price}</h2>

                        <h3>×<span>{$og.count}</span></h3>

                    </div>

                </div>

            </div>

        </volist>

        <div class="am_line"></div>

        <div class="am_list_c">

            <h5>实付款:<span>￥{$o.total}</span></h5>

            <h4>
                <!--邮费:<span> ￥0.00</span>&nbsp;&nbsp;-->

                金额:￥{$o.total}
            </h4>

        </div>

        <div class="pf_last">

            <if condition='($o.pay_status lt 2) and ($o.status eq 1)'>

                <a class="last_a" href="{:U('Pay/index',array('id'=>$o['id']))}">付款</a>

                <a onclick="dealOrder('ocancle', {$o['id']})" href="javascript:;" name="cancel_order" class="last_b oporder" id="579">取消</a>

                <elseif condition="($o.pay_status eq 2) and ($o.status eq 1) and ($o.send_status lt 1)" />

                <a onclick="dealOrder('oshouhuo', {$o['id']})" class="last_a" href="javascript:;" name="shouhuo_order"  id="579">收货</a>

                <a onclick="showmobile({$o['id']});" href="javascript:;" name="tuihuo_order" class="last_b oporder" id="579">退款</a>

                <elseif condition="{$o.pay_status eq 2} and ($o.send_status eq 2)">

                    <elseif condition="$o.status eq 2" />

                    <a onclick="dealOrder('odel', {$o['id']})" class="last_a" href="javascript:;" name="del_order"  id="579">删除</a>

            </if>

            <a href="javascript:;" class="last_b" onclick="showtime({$o['id']});">更多</a>

        </div>

        </li>

    </volist>

</ul>

<br />

</div>

<script type="text/javascript">

    function dealOrder($param, $order_id){

    var str = '';
    if ($param == 'ocancle'){
    str = '取消订单';
    } else if ($param == 'odel'){

    str = '删除订单';
    } else if ($param == 'oshouhuo'){

    str = '确认收货';
    } else if ($param == 'otuihuo'){

    str = '选择退货';
    }
    var url = "{:U('Order/deal')}";
    jConfirm(str + '？', '', function(rel){

    if (rel){

    $.post(url, {'type':$param, 'order_id':$order_id}, function(data){
    console.log(data);
    jAlert(data.info, '', function(){

    location.reload();
    });
    });
    }

    });
    }

    function showtime(id) {
    document.getElementById(id).style.display = "block";
    //document.getElementById(id).scrollIntoView(true);
    }
   function showmobile(id) {
      id  = 'ret'+id;
    document.getElementById(id).style.display = "block";
    //document.getElementById(id).scrollIntoView(true);
    }

</script>

<div id="opquyu"></div>

<include file="Public:footer" />